package test00.tx08;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Stream;

public class MainTest {
    public static void main(String[] args) {
        List<Student> list = new ArrayList<Student>();
        List<Student> list01 = new ArrayList<Student>();
        list.add(new Student("李三"));
        list.add(new Student("李四五"));
        list.add(new Student("李五五"));
        list.add(new Student("李五五"));
        list.add(new Student("李五五"));
        list.add(new Student("赵六"));
        list01.add(new Student("李三"));
        list01.add(new Student("张四四"));
        list01.add(new Student("张五四"));
        list01.add(new Student("张五四"));
        list01.add(new Student("李五四"));
        list01.add(new Student("赵六"));

        Stream<Student> stream = list.stream()
        .filter(student -> student.getName().length() >= 3)
                .limit(3);
        Stream<Student> stream01 = list01.stream()
        .filter(student -> student.getName().startsWith("张"))
                .skip(2);
        Stream<Student> stream02 = Stream.concat(stream, stream01);
        stream02.forEach(System.out::println);
    }
}
